import React, { Component } from "react"
import "./style.css"
import propTypes from "prop-types"
export class NavBar extends Component {
    render() {
        const { children } = this.props
        return (
            <div className="navbar">
                <div className="left">{children[0]}</div>
                <div className="center">{children[1]}</div>
                <div className="right">{children[2]}</div>
            </div>
        )
    }
}

// 也可以通过 propsType 来控制 父组件只传入一个react元素
/* NavBar.propTypes = {
    children: propTypes.element,
} */

export default NavBar
